package com.atguigu.lease.web.app.service;

import com.atguigu.lease.model.entity.LeaseAgreement;
import com.atguigu.lease.model.enums.LeaseStatus;
import com.atguigu.lease.web.app.vo.agreement.AgreementDetailVo;
import com.atguigu.lease.web.app.vo.agreement.AgreementItemVo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * @author liubo
 * @description 针对表【lease_agreement(租约信息表)】的数据库操作Service
 * @createDate 2023-07-26 11:12:39
 */
public interface LeaseAgreementService extends IService<LeaseAgreement> {
    /**
     * 获取当前用户的租约列表基本信息
     *
     * @return 租约列表
     */
    List<AgreementItemVo> getAgreementItemListByCurrentUser(@RequestHeader("access_token") String token);

    /**
     * 根据ID获取租约详细信息
     *
     * @param id 租约ID
     * @return 租约详细信息
     */
    AgreementDetailVo getAgreementDetailById(Long id);

    /**
     * 更新租约状态
     *
     * @param id 租约ID
     * @param leaseStatus 新的租约状态
     * @return 是否更新成功
     */
    boolean updateAgreementStatus(Long id, LeaseStatus leaseStatus);

    /**
     * 保存或更新租约信息
     *
     * @param leaseAgreement 租约信息
     * @return 是否操作成功
     */
    boolean saveOrUpdateAgreement(LeaseAgreement leaseAgreement);

}
